Italy
Italy
Data for italy are available on a daily basis from official sources and can be downloaded from the corresponding repository
# for plotly
from plotly.offline import iplot
from plotly.offline import init_notebook_mode, plot
from IPython.core.display import display, HTML
import plotly as py
import plotly.tools as tls
import datetime
import numpy as np
import pandas as pd
import hedera_covid as hc
IT = hc.DataHandlerItaly()
all_r = IT.get_all_region_names()
new_cases = []
for r in all_r:
new_cases.append(
IT.get_plot_data(r, 'nuovi_positivi',n_smooth=7)
)
deaths = []
for r in all_r:
deaths.append(
IT.get_plot_data(r, 'deceduti',n_smooth=7)
)
tests = []
for r in all_r:
tests.append(
IT.get_plot_data(r, 'tamponi',n_smooth=7)
)
#hc.plot_structure(new_cases,title="New cases")
#hc.plot_structure(deaths,title="Total deaths")
#hc.plot_structure(tests,title="Tested")
import plotly.graph_objects as go
init_notebook_mode(connected=True)
fig = {
"data": new_cases,
"layout": {"title": {"text": "Daily Cases"},
"legend": {'x':0.1, 'y':-.1},
"legend_orientation":"h",
"height": 1200,
"width": 1000
}
}
#fig.update_layout(xaxis_tickangle=-90)
#fig.update_layout()
plot(fig, filename = 'figure.html')
display(HTML('figure.html'))
import plotly.graph_objects as go
init_notebook_mode(connected=True)
fig = {
"data": deaths,
"layout": {"title": {"text": "Total deaths"}}
}
plot(fig, filename = 'figure.html')
display(HTML('figure.html'))
plot(fig, filename = 'figure.html')
display(HTML('figure.html'))